/**
 * Project: lionbule-compile
 * 
 * File Created at 2012-4-8
 * $Id$
 * 
 * Copyright 1999-2100 Alibaba.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Alibaba Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Alibaba.com.
 */
package com.antlr.sample;

import org.antlr.runtime.ANTLRStringStream;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.tree.BaseTree;

/**
 * ExprMain.
 * 
 * @author LionBule 2012-4-8 上午10:01:18
 */
public class ExprMain {

    public static void main(String[] args) throws Exception {
        String expr = "4.08/2.0+2*(3.2E-3+9.6);";
        ANTLRStringStream input = new ANTLRStringStream(expr);
        ExprLexer lexer = new ExprLexer(input);
        CommonTokenStream tokens = new CommonTokenStream(lexer);
        ExprParser parser = new ExprParser(tokens);
        ExprParser.statments_return r = parser.statments();
        System.out.println(((BaseTree) r.getTree()).toStringTree());
    }

}
